home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / PROLOG / BP330 / !ReadMe1st
Text File  |  1995-02-13  |  6KB  |  185 lines

  1. Archimedes notes
  2. ----------------
  3.  
  4. This is a port of the Bin Prolog interpreter to the acorn archimedes.
  5. It is small (bytecode interpreter is a mere 28k stripped..), 
  6. fast (c. 130Klips on RPC600 (allegedly a sparc 20 does 800 odd klips))
  7. [actually you sink down to a mere 60 odd klips if you run it in a task-
  8. window...], and has some novel features (blackboards, DCGs, bestof).
  9.  
  10.  
  11. Running BinProlog
  12. -----------------
  13. Double clicking on the icon does one of two things - either runs binprolog
  14. full screen or simply in a taskwindow - uncomment whicher line you like
  15. in !BinPro.!Run .
  16.  
  17. [Actually, there are two aliases
  18.     o bp 
  19.         runs bin prolog full screen
  20.     o bpw
  21.         runs bin prolog in a taskwindow...
  22. ]
  23.  
  24.  
  25. Loading Prolog sources
  26. ----------------------
  27. See !BinPro.!Boot for where it looks for things.
  28. It'll also happily cope with the likes of
  29.  
  30. ?- ['$.languages.binpro.!binpro.library.high'].
  31.  
  32. to load things specified by full pathnames.
  33. Note, there is a difference between the following syntaxes :
  34.  
  35. ?- ['foo'].            % load and compile foo
  36. ?- consult('foo').        % consult foo
  37.  
  38. This becomes apparent when you try listing/0 after compiling -
  39. the first syntax means no listing appears, using consult means that you
  40. do get a listing of what you just loaded into working memory (much like
  41. any other prolog).
  42.  
  43.  
  44. Memory requirements
  45. -------------------
  46. Basic is about 1.6Meg. Running small stuff won't add onto this significantly,
  47. however read on...
  48. Benchmarks and suchlike are designed for maximum horridness towards
  49. memory usage and assume you are running on a unixalike workstation and hence
  50. have ungodly amounts of memory. 
  51. Therefore - if you are running the benchmarks and get errors from 
  52. binprolog about heaps being corrupted or suchlike - this means it has run 
  53. out of memory...
  54. However, if you give it a tad more (along the lines of a couple of meg....
  55. upwards to about 5 which stops it complaining about all but the really
  56. nasty combinatorial problems), then it ceases to complain.
  57.  
  58. Moral of the story is essentially expect to get useful work done in it,
  59. but don't expect the benchmarks to always run, unless you have heaps of
  60. memory.
  61. (I suspect this doesn't garbage collect its heap.....yet - it might
  62. improve in future?)
  63.  
  64.  
  65. Things to note
  66. --------------
  67. 1.
  68. get/1 and get0/1    get(I) behaves much as you might expect - only
  69.             succeeds when you have typed a valid printable
  70.             character, followed by return.
  71.  
  72.             get0(I) behaves slightly differently to what you
  73.             might expect - it succeeds with any character,
  74.             which is correct as far as I understand it, but it
  75.             also needs to be followed by return like get/1.
  76.             I've seen a few other prologs that succeed
  77.             immediately with get0 and don't wait for return;
  78.             however I cannot see from the sources how it would
  79.             do this under unix as there is no terminal handling
  80.             code to put it into cbreak mode or similar.
  81.             In short - it works but behaves to my mind
  82.             slightly curiously....(watch this space - I may
  83.             fix it after talking to the author).
  84.  
  85. 2.
  86. Timing is disabled due to it using unixy timing functions that the Arc
  87. hasnt got - might fix. Doesnt hurt not to have?
  88.  
  89. 3.
  90. I've re-bootstrapped this to look for files in more archi specific places
  91. and with less horrid file extensions - see the !BinPro.!Boot file
  92. for what and wherefor.
  93.  
  94. 4.
  95. However, it does successfully rebootstrap itself; which is surely some
  96. indication that it is correct? ;-)
  97.  
  98. (If you are interested in re-bootstrapping it / fiddling with the internals,
  99. then get the boot sources, put these in a directory called 'boot' and
  100. peer at !BinPro.bootstrap for how to get it going -> the docs arent
  101. entirely correct with the description - it uses compile0 and NOT compile...)
  102. [changed as of 3.09..]
  103.  
  104. 5.
  105. Dont end your prolog sources on the end of a line - it requires a blank
  106. line before the end of file or it will whinge at you.
  107.  
  108. 6.
  109. If you have prolog sources that have embedded loads in, it tends to get upset
  110. due it allowing only one compiled file loaded - getting around this is to
  111. use a file to load all the other files you want loaded - along the lines of
  112.  
  113. /* load other files */
  114. :-module(prolog).
  115. :-['a'].            % load in 'a'
  116. :-['b'].            % load in 'b'
  117. :-['c'].            % load in 'c'
  118. :-module(user).
  119.  
  120. Note - this also brings up another point; if you have prolog sources that use
  121. ?- whatever.
  122. inside them to execute rules whilst loading, change them to
  123. :-whatever.
  124. and then it seems to behave itself.
  125.  
  126. 7.
  127. Due to my relaxing the filename extensions looked for, it is possible using
  128. the cmake/1 command to get it stuck in a loop reloading itself.
  129. Solution - name the project file differently to anything it includes, or
  130. explicitly end your project filenames in _pro.
  131.  
  132. 8.
  133. make_appl does now actually work okay - however you'll probably need all
  134. of the boot sources required and the thing you wish to make an app out of
  135. in the current directory before trying to get it to work...
  136. (Gives errors about functions left unlinked but does actually run the
  137. traditional 'hello world' example correctly - probably wouldn't give
  138. errors about unlinked functions if it had more of the bootstrap sources
  139. included...)
  140.  
  141. 9.
  142. (And there was me thinking I had found a bug ;-)
  143. If you load in a file using compile, i.e. 
  144. ?- ['foo'].
  145. and then consult it thereafter, i.e.
  146. ?- consult('foo').
  147. You will get some rather odd effects - try this with some facts and 
  148. findall/3 to gather up all the possibilities and you might see what I 
  149. mean.
  150. Solution is to remember to use restart/0 if you want to use consult after
  151. compile. (In actual fact, you should get a warning about interpreted code
  152. shadowing compiled code which will give you a hint strange things might
  153. happen)
  154. (This is of course not a problem if you are using different files, merely
  155. if you try it on the same one).
  156.  
  157.  
  158.  
  159. Thanks to Paul Tarau for letting me in on the sources.
  160.  
  161.  
  162. Comments / bug reports / postcards to
  163.  
  164. snailmail:
  165.     al slater
  166.     kintail,
  167.     barclay park,
  168.     aboyne,
  169.     aberdeenshire.
  170.     ab34 5jf.
  171.  
  172. email:
  173.     ams@csd.abdn.ac.uk            ; ok til june 95.
  174.  
  175.  
  176. hope someone finds it useful,
  177.  
  178. cheers,
  179. al.
  180. 13/2/95
  181.  
  182. [PPS - before anyone remarks that this appears not to be the standalone
  183. version as per the previous release....the machine generated C from
  184. the prolog bootstrap sources breaks _every_ compiler I have ...
  185. ]